import instance from '@/utils/request'

export function getRoleListRequest(params) {
  return instance({
    url: '/api/sys/role',
    method: 'get',
    params
  })
}
export function getEnabledRoleListRequest() {
  return instance({
    url: '/api/sys/role/list/enabled',
    method: 'get'
  })
}
export function addRoleListRequest(data) {
  return instance({
    url: '/api/sys/role',
    method: 'post',
    data
  })
}
export function deleteRoleRequest(id) {
  return instance({
    method: 'DELETE',
    url: `/api/sys/role/${id}`
  })
}
export function updataRoleRequest(data) {
  return instance({
    method: 'put',
    url: `/api/sys/role/${data.id}`,
    data
  })
}
export function getRoleDetailRequest(id) {
  return instance({
    method: 'GET',
    url: `/api/sys/role/${id}`
  })
}
export function assignPremRequest(data) {
  return instance({
    method: 'PUT',
    url: `/api/sys/role/assignprem`,
    data
  })
}
